<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>canvas</title>
    <style>
      .charts {
        /* width: 800px;
        height: 400px; */
        background-color: gray;
      }
    </style>
  </head>
  <body>
    <!-- <canvas class="charts" width="800" height="400"></canvas> -->
    <canvas class="charts" width="800" height="400"></canvas>
    <script>
      // 获取canvas元素
      const charts = document.querySelector('.charts');
      // 获取canvas的画笔
      // const context = charts.getContext('2d');
      const ctx = charts.getContext('2d');
      ctx.beginPath();
      ctx.arc(200, 200, 100, 0, 2 * Math.PI);
      ctx.stroke();
      ctx.closePath();

      ctx.beginPath();
      ctx.arc(200, 200, 50, 0, 2 * Math.PI);
      ctx.stroke();
      ctx.closePath();
    </script>
  </body>
</html>
